import heapq
import collections


class Solution(object):
    def largestUniqueNumber(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        c = collections.Counter(nums)
        t = [(-key, c[key]) for key in c]
        heapq.heapify(t)
        while t:
            node = heapq.heappop(t)
            if node[1] == 1:
                return - node[0]
        return -1

data = Solution()
nums = [9]
print(data.largestUniqueNumber(nums))
